package fmdao;

import java.io.*;

public class FileManager 
{
	private String file;
	private boolean exists;
	private BufferedReader br;
	
	public FileManager( String fileName )
	{
		file = fileName;
		try
		{
			br = new BufferedReader(new FileReader(file));
			exists = true;
		}
		catch( Exception e)
		{
			exists = false;
		}
	}
	
	public boolean exists()
	{
		return exists;
	}
	
	public String readLine()
	{
		String str="";
		try
		{
			str = br.readLine();
		}
		catch( Exception e )
		{
			str = "";
			try
			{
				br.close();
			}
			catch( Exception e1 )
			{
				System.out.println("No se pudo cerrar el archivo -" + file + "-");
			}
		}
		return str;
	}

}